def indent(FSPSource):
  level = 0
  indentedSource = ""
  nestedCurly = 0
  while FSPSource:
    if FSPSource[0] == "(":
      level += 1
      indentedSource += "\n"+ "\t"*(level-1) + "(\n" + "\t"*level
    elif FSPSource[0] == ")":
      level -= 1
      indentedSource += "\n" + "\t"*level + ")\n" + "\t"*level
    elif FSPSource[0] == "{":
      nestedCurly += 1
      indentedSource += FSPSource[0]
    elif FSPSource[0] == "}":
      nestedCurly -= 1
      indentedSource += FSPSource[0]
    elif FSPSource[0] == "|":
      indentedSource += FSPSource[0] +"\n" + "\t"*level
    elif FSPSource[0] == "," and nestedCurly == 0:
      indentedSource += ",\n" + "\t"*level
    else:
      indentedSource += FSPSource[0]
    FSPSource = FSPSource[1:]
  return indentedSource
